x86/mm: Reduce debug overhead of __virt_to_maddr()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 16 Aug 2017 12:01:03 +0000 (13:01 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 17 Aug 2017 11:22:48 +0000 (12:22 +0100)
commitf859e4a3b9088a76fe733fd0312b0922f90b85e1
tree849e945b6eabe470c582e49f9bd5633511b9ef94
parentfc0bb10473c19d253e4e30808ee9711a4b9fedae
x86/mm: Reduce debug overhead of __virt_to_maddr()

__virt_to_maddr() is used very frequently, but has a large footprint due to
its assertions and comparasons.

Rearange its logic to drop one assertion entirely, encoding its check in a
second assertion (with no additional branch, and the comparason performed with
a 32bit immediate rather than requiring a movabs).

Bloat-o-meter net report is:
  add/remove: 0/0 grow/shrink: 1/72 up/down: 3/-2169 (-2166)

along with a reduction of 32 assertion frames (895 down to 861)

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/include/asm-x86/x86_64/page.h